import React from 'react'
import {classHelper} from '../utils/class'
import propTypes from 'prop-types'
import icons from './myIcon.json'
class MyIcon extends React.Component {
  constructor() {
    super()
  }

  render() {
    const {name, color, size, className, style,onClick} = this.props;
    return (
      <i className={"iconfont "+name+' '+className} style={{
        ...style, color,
        fontSize: size,
        cursor:onClick?'pointer':'inherit'
      }} onClick={onClick}/>
    )
  }
}
MyIcon.propTypes = {
  name:propTypes.oneOf(icons),
  onClick:propTypes.func,
};


export default MyIcon;
